package cn.hill4j.tool.spring.ext.iop.dynamic;

import cn.hill4j.tool.spring.ext.iop.feign.IopFeignTarget;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
  * ClassName: DymFeignIopClient
  * Description: 动态feignClient定义配置注解
  * @author hillchen
  * Date: 2023/8/11
  * @version: 1.0
  */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@DynamicIop(clientBuilder = DymFeignIopClientsBuilder.class,configAnnotation = DymFeignIopClient.class,definer = DymFeignIopClientsDefiner.class,selectorClass=DymKeySelector.class)
public @interface DymFeignIopClient {
    /**
     * @author hillchen
     * Description: 动态健值获取器
     * Date: 2023/8/11 00:21
     * @return Class
     **/
    @AliasFor(annotation = DynamicIop.class)
    Class<? extends DymKeySelector<?,? extends IopFeignTarget>>selectorClass();
    /**
     * @author hillchen
     * Description: 外部配置类
     * Date: 2023/8/11 00:22
     * @return Class[]
     **/
    @AliasFor(annotation = DynamicIop.class)
    Class<?>[] configuration() default {};
    /**
     * @author hillchen
     * Description: 404异常编码标志
     * Date: 2023/8/11 00:23
     * @return boolean 为true则需要重新编码
     **/
    boolean decode404() default false;

    /**
     * @author hillchen
     * Description: 异常回调处理类
     * Date: 2023/8/11 00:23
     * @return Class
     */
    Class<?> fallback() default void.class;
    /**
     * @author hillchen
     * Description: 异常回调处理类构造工厂
     * Date: 2023/8/11 00:23
     * @return Class
     */
    Class<?> fallbackFactory() default void.class;
}
